<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <% include("/WEB-INF/view/console/common/css.html"){}	%>
 <% include("/WEB-INF/view/console/common/js.html"){} 	%>
 <title></title>
 </head>
 <body> <nav class="navbar navbar-default navbar-fixed-top site-navbar" >
  <div class="navbar-header">
 <a class="navbar-brand" href="#">商品轮播</a>
 </div>
  </nav>
 <form name="boGoodsBanner_form"  id="boGoodsBanner_form" class="form-horizontal" style="margin-top: 60px;">
 <!--  <div class="form-group" >
 <label class="col-sm-2 control-label">商品id</label>
 <div class="col-sm-6">
 <input  type="text"  name="goodsId" id="goodsId" class="form-control" check-type="required" value='${boGoodsBanner.goodsId!}' >
 </div>
  </div>-->
 <div class="form-group" >
 <label class="col-sm-2 control-label">排序</label>
 <div class="col-sm-6">
 <input  type="text"  name="sort" id="sort" class="form-control" check-type="required" value='${boGoodsBanner.sort!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 control-label">状态</label>
 <div class="col-sm-6">
 <label><input  auto_name='boGoodsBanner_status' type="radio"  name="status" value="0"/>不可用</label>
 <label><input checked='checked'  auto_name='boGoodsBanner_status' type="radio"  name="status" value="1"/>可用</label>
  
 </div>
  </div>
 	<script type="text/javascript">
       $(function($){
       $('input[auto_name="boGoodsBanner_status"]').each(function(){
       if('${boGoodsBanner.status!}'==this.value){ 
             $(this).attr('checked','checked');
            }
           });
 	    });
 	</script> 
  <div class="form-group" >
 <label class="col-sm-2 control-label">banner图片</label>
 <div class="col-sm-3">
   <span class="btn btn-success fileinput-button">
        <i class="glyphicon glyphicon-plus"></i>
        <span>添加</span>
  <input type="file" id="bannerImg_file" class="form-control" value='${boGoodsBanner.bannerImg!}' >
  <input type="hidden" id="bannerImg"  name="bannerImg"class="form-control" value='${boGoodsBanner.bannerImg!}' >
    </span>
  <div id="bannerImg_progress" class="progress">
   <div class="progress-bar progress-bar-success"></div>
  </div>
  </div>
   	<div class="col-sm-4">
   	<img id="bannerImg_file_show" src="${boGoodsBanner.bannerImg!}" style="width:100px;" alt="图片" class="img-rounded">
 </div>
 </div>

   <script type="text/javascript"> 
 $(function($){
  consoleUploadAliImg('bannerImg','${ctxPath}');
 });
 </script> 
   <input type='hidden' name='id' id='id' value='${boGoodsBanner.id!}'><input type='hidden' name='common_token' id='common_token' value='${common_token!}'>
 <div class="form-group" style="margin-bottom: 60px;"></div>
 </form>
 <script type="text/javascript">
 $(function($) {
    /*开启表单验证*/
 	$("#boGoodsBanner_form").validation();
 });
 /*保存*/
 function saveZqForm(){
    if ($("#boGoodsBanner_form").valid() == false) {
 	    return false;
    }
    var formObject=new Object();
    formObject.goodsId="${boGoodsBanner.goodsId!}";
 formObject.bannerImg=$('#bannerImg').val()==''?null:$('#bannerImg').val(); 
 formObject.sort=$('#sort').val()==''?null:$('#sort').val(); 
 formObject.status=($('input[name="status"]:checked').val()==''?null:$('input[name="status"]:checked').val()); 
 formObject.id=$('#id').val()==''?null:$('#id').val(); 
 
    var formObjectJson = JSON.stringify(formObject);
    $.post("${ctxPath}/console/bo_goods_banner/save",
     {
           formObjectJson :formObjectJson,
 	   table_name :'boGoodsBanner',
 	   common_token :$("#common_token").val()
     }, function(data) {
            $.confirm({
                title: '提示',
                content: data.message,
                autoClose: 'cancelAction|3000',
                escapeKey: 'cancelAction',
                buttons: {
                    cancelAction: {
                        text: '确定',
                        action: function () {
                            parent.$("#boGoodsBanner").bootstrapTable("refresh");
                            parent.art.dialog.get('id-dialog-boGoodsBanner').close();
                        }
                    }
                }
            });
     });
 }
 </script>
 <nav class="navbar navbar-default navbar-fixed-bottom site-navbar" >
 <div class="container" style="padding-top:10px;padding-bottom:10px;">
 <div class="nav navbar-nav navbar-right">
 <a href="#" class="btn btn-success"  onclick='saveZqForm()'>保存 </a>
  </div>
  </div>
  </nav>
 </body>
